<!-- Begin one column window -->
<div class="onecolumn">
    <div class="header">
        <span style="font-weight: bold; text-align: center; color: red;">Danh sách bài viết</span>
    </div>
    <br class="clear"/>
    <div class="content">
        <table class="data" width="100%" cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <th style="width:5%">STT</th>
                    <th style="width:15%">Phân loại</th>
                    <th style="width:28%">Chủ đề</th>
                    <th style="width:10%">Ngày tạo</th>
                    <th style="width:25%">Mô tả</th>
                    <th style="width:7%">Xuất bản</th>
                    <th style="width:10%">Thao tác</th>
                </tr>
            </thead>
            <tbody>
                <?php $i = 1; ?>
                <?php foreach ($paginator as $row) : ?>

                    <tr>
                        <td><?php echo $this->escapeHtml($i++); ?></td>
                         <td><?php echo $this->escapeHtml($row->categoryName.'/'.$row->subCategoryName); ?></td>
                        <td><?php echo $this->escapeHtml($row->title); ?></td>
                        <td>
                            <?php
                            $dateCreated = new DateTime($row->dateCreated);
                            echo $this->escapeHtml($dateCreated->format('d-m-Y'));
                            ?>
                        </td>
                        <td><?php echo $this->escapeHtml($row->description); ?></td>
                        <td>
                            <?php if ($row->isPublisher == 0): ?>
                                <a href="<?php echo $this->url('article-management/default', array('action' => 'publishArticle', 'id' => $row->articleID)) ?>" style="margin-left: 30px;"><img src=<?php echo $this->basePath() . '/img/icon_delete.png' ?> alt="delete" class="help" title="Xuất bản"/></a>
                            <?php else: ?>
                                <a href="<?php echo $this->url('article-management/default', array('action' => 'unPublishArticle', 'id' => $row->articleID)) ?>" style="margin-left: 30px;"><img src=<?php echo $this->basePath() . '/img/icon_accept.png' ?> alt="delete" class="help" title="Không xuất bản"/></a>
                            <?php endif; ?>
                        </td>

                        <td>
                            <a href="<?php echo $this->url('article-management/default', array('action' => 'editArticle', 'id' => $row->articleID)) ?>"><img src=<?php echo $this->basePath() . '/img/icon_edit.png' ?> alt="edit" class="help" title="Chỉnh sửa"/></a>
                            <a href="<?php echo $this->url('article-management/default', array('action' => 'deleteArticle', 'id' => $row->articleID)) ?>" style="margin-left: 30px;"><img src=<?php echo $this->basePath() . '/img/delete.png' ?> alt="delete" class="help" title="Xóa bài viết"/></a>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
        <?php
        // add at the end of the file after the table
        echo $this->paginationControl(
                // the paginator object
                $this->paginator,
                // the scrolling style; see http://zf2.readthedocs.org/en/release-2.1.4/modules/zend.paginator.usage.html#rendering-pages-with-view-scripts
                'sliding',
                // the partial to use to render the control
                array('partial/paginator.phtml', 'Admin'),
                // the route to link to when a user clicks a control link
                array(
            'route' => 'article-management'
                )
        );
        ?>
        </form>

    </div>
</div>
<!-- End one column window -->